package cn.coisini.utils;

import cn.hutool.json.JSONUtil;

import java.util.HashMap;
import java.util.Map;

/**
 * @author xiangshaw
 * Description: 自定义Json工具类
 */
public class JsonUtil {

    private JsonUtil() {
        throw new IllegalStateException("Utility class");
    }
    public static Map<String, Object> toMap(String json) {
        Map<String, Object> map = new HashMap<>();
        Map<?, ?> rawMap = JSONUtil.toBean(json, Map.class);
        rawMap.forEach((k, v) -> map.put((String) k, v));
        return map;
    }
}
